<?php
// App\Controller\Demo\DemoController.php
namespace App\Api;

use Common\ApiController;
use Common\Sign\ProjectSign;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\HttpServer\Annotation\RequestMapping;

#[Controller(prefix: 'api/ceshi')]
class CeshiController extends ApiController
{
    public  array $signOptional = ['sign'];

    //允许通过 GET 或 POST 方式请求
    #[PostMapping(path: "sign")]
    public function sign()
    {
        $Sign = new ProjectSign();
        $body = $this->request->getParsedBody();
        $all =  $this->request->all();
        $Res = $Sign->getSign($body);
        return $this->writeJson(200, ['sign'=>$Res,'body'=>$body,'all'=>$all], '欢迎使用店滴云物联网服务');
    }

}